package org.dromara.system.domain.vo;

import java.util.ArrayList;
import java.util.Date;

import cn.hutool.core.lang.Dict;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.dromara.system.domain.SysMember;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;


/**
 * 微信用户视图对象 sys_member
 *
 * @author yilong.fu
 * @date 2024-09-14
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ExcelIgnoreUnannotated
@AutoMapper(target = SysMember.class)
public class SysMemberVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 用户ID
     */
    @ExcelProperty(value = "用户ID")
    private Long memberId;

    /**
     * 用户名
     */
    @ExcelProperty(value = "用户名")
    private String name;

    /**
     * 密码
     */
    @ExcelProperty(value = "密码")
    private String password;

    /**
     * 用户的性别（1是男性，2是女性，0是未知）
     */
    @ExcelProperty(value = "用户的性别", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "1=是男性，2是女性，0是未知")
    private Integer gender;

    /**
     * 生日
     */
    @ExcelProperty(value = "生日")
    private Date birthday;

    /**
     * 注册时间
     */
    @ExcelProperty(value = "注册时间")
    private Date registerTime;

    /**
     * 最后登录时间
     */
    @ExcelProperty(value = "最后登录时间")
    private Date lastLoginTime;

    /**
     * 最后登录IP
     */
    @ExcelProperty(value = "最后登录IP")
    private String lastLoginIp;

    /**
     * 微信昵称
     */
    @ExcelProperty(value = "微信昵称")
    private String nickname;

    /**
     * 手机号
     */
    @ExcelProperty(value = "手机号")
    private String mobile;

    /**
     * 注册ip
     */
    @ExcelProperty(value = "注册ip")
    private String registerIp;

    /**
     * 用户头像
     */
    @ExcelProperty(value = "用户头像")
    private String headImgUrl;

    /**
     * 用户的标识
     */
    @ExcelProperty(value = "用户的标识")
    private String openId;

    /**
     * 用户唯一标识
     */
    @ExcelProperty(value = "用户唯一标识")
    private String unionId;

    /**
     * 公众号的标识
     */
    private String publicId;

    /**
     * 会话KEY
     */
    @ExcelProperty(value = "会话KEY")
    private String sessionKey;

    /**
     * 是否授权
     */
    @ExcelProperty(value = "是否授权")
    private Integer authorized;

    /**
     * 应用编号
     */
    @ExcelProperty(value = "应用编号")
    private String appCode;

    /**
     * 用户编号
     */
    @ExcelProperty(value = "用户编号")
    private String cide;

    /**
     * 推荐人
     */
    @ExcelProperty(value = "推荐人")
    private String referee;

    private final List<String> mappRoles = new ArrayList<>();

    private final List<Dict> mappGroups = new ArrayList<>();

    /**
     * 黑名单用户
     */
    private Integer black;

    private Dict mappUserExtendConfigVo;

    private Dict mappUser;

}
